from django.contrib import admin
from .models import WordGroup,Word,WordSpell

class WordAdmin(admin.ModelAdmin):
    icon = '<i class="material-icons">g_translate</i>'
    list_display = ('id',"name","phonetic","syllable","word_bank_id",)
    list_display_links = ('id','word_bank_id','name',"word_bank_id",)
    raw_id_fields = ('word_group',)
    search_fields = ('name','word_bank_id')

    # list_filter = ('word_group',)


class WordGroupAdmin(admin.ModelAdmin):
    icon = '<i class="material-icons">widgets</i>'
    model = "WordGroup"
    list_display = ('id','word_bank_id','part_no','story_audio','audio_time','image_name')
    list_display_links = ('id','word_bank_id','part_no', 'story_audio')
    list_filter = ('part_no',)
    search_fields = ('part_no','story_audio','word_bank_id')



class WordSpellAdmin(admin.ModelAdmin):
    icon = '<i class="material-icons">font_download</i>'
    list_display = ("id","symbol","word",)
    raw_id_fields = ('word',)
    search_fields = ('word__name',)


# Register your models here.
admin.site.register(Word,WordAdmin)
admin.site.register(WordGroup,WordGroupAdmin)
admin.site.register(WordSpell,WordSpellAdmin)
